function vng_ads_lib() {
    this.zone_ids	=	{
        /* Zing News Home */
        '1': {
            'advTop': '814',
            'advR1': '96',
            'advR2': '920',
            'advR3': '99',
            'advFloat':'264',
            'advFooter': '1320'
        },
        /* Zing News XaHoi - PhongSu - TuThien - DoiSong - Phap Luat - DangSauvuAn*/
        '84': {
            'advTop': '799',
            'advR1': '187',
            'advR2': '907',
            'advLeft': '504',
            'advRight':'505',
            'advBottom': '387',
            'advArticle': '202',
            'advFooter': '1321'
        },
        '567': {
            'advTop': '799',
            'advR1': '187',
            'advR2': '907',
            'advLeft': '504',
            'advRight':'505',
            'advBottom': '387',
            'advArticle': '202',
            'advFooter': '1321'
        },
        '511': {
            'advTop': '799',
            'advR1': '187',
            'advR2': '907',
            'advLeft': '504',
            'advRight':'505',
            'advBottom': '387',
            'advArticle': '202',
            'advFooter': '1321'
        },
        '571': {
            'advTop': '799',
            'advR1': '187',
            'advR2': '907',
            'advLeft': '504',
            'advRight':'505',
            'advBottom': '387',
            'advArticle': '202',
            'advFooter': '1321'
        },
        '482': {
            'advTop': '799',
            'advR1': '187',
            'advR2': '907',
            'advLeft': '504',
            'advRight':'505',
            'advBottom': '387',
            'advArticle': '202',
            'advFooter': '1321'
        },
        '573': {
            'advTop': '799',
            'advR1': '187',
            'advR2': '907',
            'advLeft': '504',
            'advRight':'505',
            'advBottom': '387',
            'advArticle': '202',
            'advFooter': '1321'
        },

        /* Kinh Doanh - ThongTinDoanhNghiep - thiTruong - taichinhchungkhoan - batdongsan*/
        '572': {
            'advTop': '1535',
            'advR1': '1536',
            'advR2': '1537',
            'advLeft': '1541',
            'advRight':'1542',
            'advBottom': '1539',
            'advArticle': '1538',
            'advFooter': '1540'
        },
        '477': {
            'advTop': '1535',
            'advR1': '1536',
            'advR2': '1537',
            'advLeft': '1541',
            'advRight':'1542',
            'advBottom': '1539',
            'advArticle': '1538',
            'advFooter': '1540'
        },
        '586': {
            'advTop': '1535',
            'advR1': '1536',
            'advR2': '1537',
            'advLeft': '1541',
            'advRight':'1542',
            'advBottom': '1539',
            'advArticle': '1538',
            'advFooter': '1540'
        },
        '587': {
            'advTop': '1535',
            'advR1': '1536',
            'advR2': '1537',
            'advLeft': '1541',
            'advRight':'1542',
            'advBottom': '1539',
            'advArticle': '1538',
            'advFooter': '1540'
        },
        '588': {
            'advTop': '1535',
            'advR1': '1536',
            'advR2': '1537',
            'advLeft': '1541',
            'advRight':'1542',
            'advBottom': '1539',
            'advArticle': '1538',
            'advFooter': '1540'
        },
        /* Zing News Thethao - Chuyen Nhuong - Game du doan - the thao bbc - doi tuyen quoc gia - V-League - u23 VN- bong da nu -
		HauTruong - thethaoClip - Bundesliga - Vietnam - NH Anh - La Liga - Serie A - BongDa Chau Au - tt quocte - duaxe -
		thethaokhac - game mini */
        '472': {
            'advTop': '189',
            'advR1': '190',
            'advR2': '909',
            'advLeft': '715',
            'advRight':'716',
            'advBottom': '394',
            'advArticle': '230',
            'advFooter': '1323'
        },
        '538': {
            'advTop': '189',
            'advR1': '190',
            'advR2': '909',
            'advLeft': '715',
            'advRight':'716',
            'advBottom': '394',
            'advArticle': '230',
            'advFooter': '1323'
        },
        '540': {
            'advTop': '189',
            'advR1': '190',
            'advR2': '909',
            'advLeft': '715',
            'advRight':'716',
            'advBottom': '394',
            'advArticle': '230',
            'advFooter': '1323'
        },
        '541': {
            'advTop': '189',
            'advR1': '190',
            'advR2': '909',
            'advLeft': '715',
            'advRight':'716',
            'advBottom': '394',
            'advArticle': '230',
            'advFooter': '1323'
        },
        '542': {
            'advTop': '189',
            'advR1': '190',
            'advR2': '909',
            'advLeft': '715',
            'advRight':'716',
            'advBottom': '394',
            'advArticle': '230',
            'advFooter': '1323'
        },
        '543': {
            'advTop': '189',
            'advR1': '190',
            'advR2': '909',
            'advLeft': '715',
            'advRight':'716',
            'advBottom': '394',
            'advArticle': '230',
            'advFooter': '1323'
        },
        '544': {
            'advTop': '189',
            'advR1': '190',
            'advR2': '909',
            'advLeft': '715',
            'advRight':'716',
            'advBottom': '394',
            'advArticle': '230',
            'advFooter': '1323'
        },
        '545': {
            'advTop': '189',
            'advR1': '190',
            'advR2': '909',
            'advLeft': '715',
            'advRight':'716',
            'advBottom': '394',
            'advArticle': '230',
            'advFooter': '1323'
        },
        '546': {
            'advTop': '189',
            'advR1': '190',
            'advR2': '909',
            'advLeft': '715',
            'advRight':'716',
            'advBottom': '394',
            'advArticle': '230',
            'advFooter': '1323'
        },
        '547': {
            'advTop': '189',
            'advR1': '190',
            'advR2': '909',
            'advLeft': '715',
            'advRight':'716',
            'advBottom': '394',
            'advArticle': '230',
            'advFooter': '1323'
        },
        '548': {
            'advTop': '189',
            'advR1': '190',
            'advR2': '909',
            'advLeft': '715',
            'advRight':'716',
            'advBottom': '394',
            'advArticle': '230',
            'advFooter': '1323'
        },
        '549': {
            'advTop': '189',
            'advR1': '190',
            'advR2': '909',
            'advLeft': '715',
            'advRight':'716',
            'advBottom': '394',
            'advArticle': '230',
            'advFooter': '1323'
        },
        '550': {
            'advTop': '189',
            'advR1': '190',
            'advR2': '909',
            'advLeft': '715',
            'advRight':'716',
            'advBottom': '394',
            'advArticle': '230',
            'advFooter': '1323'
        },
        '551': {
            'advTop': '189',
            'advR1': '190',
            'advR2': '909',
            'advLeft': '715',
            'advRight':'716',
            'advBottom': '394',
            'advArticle': '230',
            'advFooter': '1323'
        },
        '552': {
            'advTop': '189',
            'advR1': '190',
            'advR2': '909',
            'advLeft': '715',
            'advRight':'716',
            'advBottom': '394',
            'advArticle': '230',
            'advFooter': '1323'
        },
        '553': {
            'advTop': '189',
            'advR1': '190',
            'advR2': '909',
            'advLeft': '715',
            'advRight':'716',
            'advBottom': '394',
            'advArticle': '230',
            'advFooter': '1323'
        },
        '554': {
            'advTop': '189',
            'advR1': '190',
            'advR2': '909',
            'advLeft': '715',
            'advRight':'716',
            'advBottom': '394',
            'advArticle': '230',
            'advFooter': '1323'
        },
        '555': {
            'advTop': '189',
            'advR1': '190',
            'advR2': '909',
            'advLeft': '715',
            'advRight':'716',
            'advBottom': '394',
            'advArticle': '230',
            'advFooter': '1323'
        },
        '556': {
            'advTop': '189',
            'advR1': '190',
            'advR2': '909',
            'advLeft': '715',
            'advRight':'716',
            'advBottom': '394',
            'advArticle': '230',
            'advFooter': '1323'
        },
        '557': {
            'advTop': '189',
            'advR1': '190',
            'advR2': '909',
            'advLeft': '715',
            'advRight':'716',
            'advBottom': '394',
            'advArticle': '230',
            'advFooter': '1323'
        },
        '558': {
            'advTop': '189',
            'advR1': '190',
            'advR2': '909',
            'advLeft': '715',
            'advRight':'716',
            'advBottom': '394',
            'advArticle': '230',
            'advFooter': '1323'
        },
        '559': {
            'advTop': '189',
            'advR1': '190',
            'advR2': '909',
            'advLeft': '715',
            'advRight':'716',
            'advBottom': '394',
            'advArticle': '230',
            'advFooter': '1323'
        },
        '560': {
            'advTop': '189',
            'advR1': '190',
            'advR2': '909',
            'advLeft': '715',
            'advRight':'716',
            'advBottom': '394',
            'advArticle': '230',
            'advFooter': '1323'
        },
        '561': {
            'advTop': '189',
            'advR1': '190',
            'advR2': '909',
            'advLeft': '715',
            'advRight':'716',
            'advBottom': '394',
            'advArticle': '230',
            'advFooter': '1323'
        },
        '562': {
            'advTop': '189',
            'advR1': '190',
            'advR2': '909',
            'advLeft': '715',
            'advRight':'716',
            'advBottom': '394',
            'advArticle': '230',
            'advFooter': '1323'
        },
        '563': {
            'advTop': '189',
            'advR1': '190',
            'advR2': '909',
            'advLeft': '715',
            'advRight':'716',
            'advBottom': '394',
            'advArticle': '230',
            'advFooter': '1323'
        },
        '564': {
            'advTop': '189',
            'advR1': '190',
            'advR2': '909',
            'advLeft': '715',
            'advRight':'716',
            'advBottom': '394',
            'advArticle': '230',
            'advFooter': '1323'
        },
        '565': {
            'advTop': '189',
            'advR1': '190',
            'advR2': '909',
            'advLeft': '715',
            'advRight':'716',
            'advBottom': '394',
            'advArticle': '230',
            'advFooter': '1323'
        },
        '536': {
            'advTop': '189',
            'advR1': '190',
            'advR2': '909',
            'advLeft': '715',
            'advRight':'716',
            'advBottom': '394',
            'advArticle': '230',
            'advFooter': '1323'
        },
        '539': {
            'advTop': '189',
            'advR1': '190',
            'advR2': '909',
            'advLeft': '715',
            'advRight':'716',
            'advBottom': '394',
            'advArticle': '230',
            'advFooter': '1323'
        },
        '534': {
            'advTop': '189',
            'advR1': '190',
            'advR2': '909',
            'advLeft': '715',
            'advRight':'716',
            'advBottom': '394',
            'advArticle': '230',
            'advFooter': '1323'
        },
        '530': {
            'advTop': '189',
            'advR1': '190',
            'advR2': '909',
            'advLeft': '715',
            'advRight':'716',
            'advBottom': '394',
            'advArticle': '230',
            'advFooter': '1323'
        },
        '531': {
            'advTop': '189',
            'advR1': '190',
            'advR2': '909',
            'advLeft': '715',
            'advRight':'716',
            'advBottom': '394',
            'advArticle': '230',
            'advFooter': '1323'
        },
        '532': {
            'advTop': '189',
            'advR1': '190',
            'advR2': '909',
            'advLeft': '715',
            'advRight':'716',
            'advBottom': '394',
            'advArticle': '230',
            'advFooter': '1323'
        },
        '533': {
            'advTop': '189',
            'advR1': '190',
            'advR2': '909',
            'advLeft': '715',
            'advRight':'716',
            'advBottom': '394',
            'advArticle': '230',
            'advFooter': '1323'
        },
        '535': {
            'advTop': '189',
            'advR1': '190',
            'advR2': '909',
            'advLeft': '715',
            'advRight':'716',
            'advBottom': '394',
            'advArticle': '230',
            'advFooter': '1323'
        },
        '525': {
            'advTop': '189',
            'advR1': '190',
            'advR2': '909',
            'advLeft': '715',
            'advRight':'716',
            'advBottom': '394',
            'advArticle': '230',
            'advFooter': '1323'
        },
        '537': {
            'advTop': '189',
            'advR1': '190',
            'advR2': '909',
            'advLeft': '715',
            'advRight':'716',
            'advBottom': '394',
            'advArticle': '230',
            'advFooter': '1323'
        },
        '568': {
            'advTop': '189',
            'advR1': '190',
            'advR2': '909',
            'advLeft': '715',
            'advRight':'716',
            'advBottom': '394',
            'advArticle': '230',
            'advFooter': '1323'
        },
        /* Zing News TheGioi - chuyenLaBonPhuong - anhVideoClip - khampha - khoahocquansu */
        '503': {
            'advTop': '800',
            'advR1': '567',
            'advR2': '908',
            'advLeft': '572',
            'advRight':'573',
            'advBottom': '611',
            'advArticle': '574',
            'advFooter': '1322'
        },
        '513': {
            'advTop': '800',
            'advR1': '567',
            'advR2': '908',
            'advLeft': '572',
            'advRight':'573',
            'advBottom': '611',
            'advArticle': '574',
            'advFooter': '1322'
        },
        '569': {
            'advTop': '800',
            'advR1': '567',
            'advR2': '908',
            'advLeft': '572',
            'advRight':'573',
            'advBottom': '611',
            'advArticle': '574',
            'advFooter': '1322'
        },
        '570': {
            'advTop': '800',
            'advR1': '567',
            'advR2': '908',
            'advLeft': '572',
            'advRight':'573',
            'advBottom': '611',
            'advArticle': '574',
            'advFooter': '1322'
        },
        /* Zing News SanhDieu - Otoxemay - Mobile - CongNghe - Hoi Dap - noi dung so - the gioi xe - thu xe */
        '473': {
            'advTop': '803',
            'advR1': '199',
            'advR2': '911',
            'advLeft': '667',
            'advRight':'668',
            'advBottom': '391',
            'advArticle': '416',
            'advFooter': '1325'
        },
        '474': {
            'advTop': '803',
            'advR1': '199',
            'advR2': '911',
            'advLeft': '667',
            'advRight':'668',
            'advBottom': '391',
            'advArticle': '416',
            'advFooter': '1325'
        },
        '475': {
            'advTop': '803',
            'advR1': '199',
            'advR2': '911',
            'advLeft': '667',
            'advRight':'668',
            'advBottom': '391',
            'advArticle': '416',
            'advFooter': '1325'
        },
        '476': {
            'advTop': '803',
            'advR1': '199',
            'advR2': '911',
            'advLeft': '667',
            'advRight':'668',
            'advBottom': '1616',
            'advArticle': '416',
            'advFooter': '1325'
        },
        '504': {
            'advTop': '803',
            'advR1': '199',
            'advR2': '911',
            'advLeft': '667',
            'advRight':'668',
            'advBottom': '391',
            'advArticle': '416',
            'advFooter': '1325'
        },
        '594': {
            'advTop': '803',
            'advR1': '199',
            'advR2': '911',
            'advLeft': '667',
            'advRight':'668',
            'advBottom': '391',
            'advArticle': '416',
            'advFooter': '1325'
        },
        '596': {
            'advTop': '803',
            'advR1': '199',
            'advR2': '911',
            'advLeft': '667',
            'advRight':'668',
            'advBottom': '391',
            'advArticle': '416',
            'advFooter': '1325'
        },
        '597': {
            'advTop': '803',
            'advR1': '199',
            'advR2': '911',
            'advLeft': '667',
            'advRight':'668',
            'advBottom': '391',
            'advArticle': '416',
            'advFooter': '1325'
        },

        /* Zing News SongTre - Giaoduc - ViecLam- Teen viet - Trac Nghiem*/
        '104': {
            'advTop': '802',
            'advR1': '241',
            'advR2': '910',
            'advLeft': '564',
            'advRight':'565',
            'advBottom': '390',
            'advArticle': '201',
            'advFooter': '1324'
        },
        '501': {
            'advTop': '802',
            'advR1': '241',
            'advR2': '910',
            'advLeft': '564',
            'advRight':'565',
            'advBottom': '390',
            'advArticle': '201',
            'advFooter': '1324'
        },
        '497': {
            'advTop': '802',
            'advR1': '241',
            'advR2': '910',
            'advLeft': '564',
            'advRight':'565',
            'advBottom': '390',
            'advArticle': '201',
            'advFooter': '1324'
        },
        '502': {
            'advTop': '802',
            'advR1': '241',
            'advR2': '910',
            'advLeft': '564',
            'advRight':'565',
            'advBottom': '390',
            'advArticle': '201',
            'advFooter': '1324'
        },
        '481': {
            'advTop': '802',
            'advR1': '241',
            'advR2': '910',
            'advLeft': '564',
            'advRight':'565',
            'advBottom': '390',
            'advArticle': '201',
            'advFooter': '1324'
        },

        /* Zing News Amnhac - Cam nhan - Vietnam - Chau A - QuocTe*/
        '8': {
            'advTop': '804',
            'advR1': '193',
            'advR2': '912',
            'advLeft': '497',
            'advRight':'498',
            'advBottom': '386',
            'advArticle': '417',
            'advFooter': '1326'
        },
        '39': {
            'advTop': '804',
            'advR1': '193',
            'advR2': '912',
            'advLeft': '497',
            'advRight':'498',
            'advBottom': '386',
            'advArticle': '417',
            'advFooter': '1326'
        },
        '216': {
            'advTop': '804',
            'advR1': '193',
            'advR2': '912',
            'advLeft': '497',
            'advRight':'498',
            'advBottom': '386',
            'advArticle': '417',
            'advFooter': '1326'
        },
        '500': {
            'advTop': '804',
            'advR1': '193',
            'advR2': '912',
            'advLeft': '497',
            'advRight':'498',
            'advBottom': '386',
            'advArticle': '417',
            'advFooter': '1326'
        },
        '232': {
            'advTop': '804',
            'advR1': '193',
            'advR2': '912',
            'advLeft': '497',
            'advRight':'498',
            'advBottom': '386',
            'advArticle': '417',
            'advFooter': '1326'
        },
        /* Zing News PhimAnh - Vietnam- PhimChauA - Quoc Te - Truyen Hinh - Chieu Rap*/
        '9': {
            'advTop': '805',
            'advR1': '196',
            'advR2': '914',
            'advLeft': '506',
            'advRight':'507',
            'advBottom': '393',
            'advArticle': '418',
            'advFooter': '1327'
        },
        '41': {
            'advTop': '805',
            'advR1': '196',
            'advR2': '914',
            'advLeft': '506',
            'advRight':'507',
            'advBottom': '393',
            'advArticle': '418',
            'advFooter': '1327'
        },
        '413': {
            'advTop': '805',
            'advR1': '196',
            'advR2': '914',
            'advLeft': '506',
            'advRight':'507',
            'advBottom': '393',
            'advArticle': '418',
            'advFooter': '1327'
        },
        '527': {
            'advTop': '805',
            'advR1': '196',
            'advR2': '914',
            'advLeft': '506',
            'advRight':'507',
            'advBottom': '393',
            'advArticle': '418',
            'advFooter': '1327'
        },
        '592': {
            'advTop': '805',
            'advR1': '196',
            'advR2': '914',
            'advLeft': '506',
            'advRight':'507',
            'advBottom': '393',
            'advArticle': '418',
            'advFooter': '1327'
        },
        '593': {
            'advTop': '805',
            'advR1': '196',
            'advR2': '914',
            'advLeft': '506',
            'advRight':'507',
            'advBottom': '393',
            'advArticle': '418',
            'advFooter': '1327'
        },

        /* Zing The Gioi Sao - viet nam - quoc te*/
        '585': {
            'advTop': '807',
            'advR1': '211',
            'advR2': '916',
            'advLeft': '669',
            'advRight':'670',
            'advBottom': '389',
            'advArticle': '422',
            'advFooter': '1329'
        },
        '598': {
            'advTop': '807',
            'advR1': '211',
            'advR2': '916',
            'advLeft': '669',
            'advRight':'670',
            'advBottom': '389',
            'advArticle': '422',
            'advFooter': '1329'
        },
        '599': {
            'advTop': '807',
            'advR1': '211',
            'advR2': '916',
            'advLeft': '669',
            'advRight':'670',
            'advBottom': '389',
            'advArticle': '422',
            'advFooter': '1329'
        },

        /* Zing Blog - Am Thuc - Du lich - Tinh Yeu*/
        '529': {
            'advTop': '808',
            'advR1': '717',
            'advR2': '913',
            'advLeft': '724',
            'advRight':'725',
            'advBottom': '956',
            'advArticle': '722',
            'advFooter': '1330'
        },
        '478': {
            'advTop': '808',
            'advR1': '717',
            'advR2': '913',
            'advLeft': '724',
            'advRight':'725',
            'advBottom': '956',
            'advArticle': '722',
            'advFooter': '1330'
        },
        '479': {
            'advTop': '808',
            'advR1': '717',
            'advR2': '913',
            'advLeft': '724',
            'advRight':'725',
            'advBottom': '956',
            'advArticle': '722',
            'advFooter': '1330'
        },
        '575': {
            'advTop': '808',
            'advR1': '717',
            'advR2': '913',
            'advLeft': '724',
            'advRight':'725',
            'advBottom': '956',
            'advArticle': '722',
            'advFooter': '1330'
        },
        '484': {
            'advTop': '808',
            'advR1': '717',
            'advR2': '913',
            'advLeft': '724',
            'advRight':'725',
            'advBottom': '956',
            'advArticle': '722',
            'advFooter': '1330'
        },


        /* Zing Dep - thoi trang - lam dep - nguoidep */
        '7': {
            'advTop': '809',
            'advR1': '217',
            'advR2': '917',
            'advLeft': '671',
            'advRight':'672',
            'advBottom': '399',
            'advArticle': '424',
            'advFooter': '1331'
        },
        '37': {
            'advTop': '809',
            'advR1': '217',
            'advR2': '917',
            'advLeft': '671',
            'advRight':'672',
            'advBottom': '399',
            'advArticle': '424',
            'advFooter': '1331'
        },
        '203': {
            'advTop': '809',
            'advR1': '217',
            'advR2': '917',
            'advLeft': '671',
            'advRight':'672',
            'advBottom': '399',
            'advArticle': '424',
            'advFooter': '1331'
        },
        '197': {
            'advTop': '809',
            'advR1': '217',
            'advR2': '917',
            'advLeft': '671',
            'advRight':'672',
            'advBottom': '399',
            'advArticle': '424',
            'advFooter': '1331'
        },


        /* giao luu truc tuyen */
        '10': {
            'advTop': '1576',
            'advR1': '1577'
        },

        /* Tuyen Sinh*/
        '574': {
            'advTop': '1522',
            'advR1': '1527',
            'advR2': '1528',
            'advLeft': '1531',
            'advRight':'1532',
            'advBottom': '1529',
            'advArticle': '1530',
            'advFooter': '1533'
        }

    };

    /* Func: Search Zone on Page */
    this.search_zoneid = function (pageid, section) {
        var zone_id	=	this.zone_ids[pageid][section];
        if(zone_id == undefined){
            return false;
        }else{
            return zone_id;
        }
    };

    /* Func: show Banner on Zone */
    this.showBanner = function (section) {
        var zone_id = this.search_zoneid(zaConfig.pageid, section);
        this.display_ad(zone_id, section + "_temp", section);
    };

    /* Func: Display Banner on Zone */
    this.display_ad = function (zone_id, id_div_dynamic, id_div_static) {
        if (!$("#" + id_div_dynamic).attr("id") || !$("#" + id_div_static).attr("id")) {
            return false
        }
        if (!zone_id) {
            return
        }
        $("#" + id_div_dynamic).css("display", "none");
        this._display_zone(zone_id);
        $(document).ready(function () {
            if ($("#" + id_div_dynamic).height() > 0) {
                $("#" + id_div_static).height($("#" + id_div_dynamic).height());
                $("#" + id_div_static).css("margin-bottom", "10px");
                var postition = $("#" + id_div_static).offset();
                var top = postition.top + "px";
                var left = postition.left + "px";
                $("#" + id_div_dynamic).css("left", left);
                $("#" + id_div_dynamic).css("top", top);
                $("#" + id_div_dynamic).css("position", "absolute");
                $("#" + id_div_dynamic).css("display", "block")
            }
        })
    };

    /* Func: Display Zone */
    this._display_zone = function (zone_id) {
        if (!zone_id) {
            return
        }
        var b = location.protocol == "https:" ? "https://ad.zing.vn/trueclick/www/delivery/ajs.php" : "http://ad.zing.vn/trueclick/www/delivery/ajs.php";
        var c = Math.floor(Math.random() * 99999999999);
        if (!document.MAX_used) document.MAX_used = ",";
        document.write("<scr" + "ipt type='text/javascript' src='" + b);
        document.write("?zoneid=" + zone_id);
        document.write("&cb=" + c);
        if (document.MAX_used != ",") document.write("&exclude=" + document.MAX_used);
        document.write(document.charset ? "&charset=" + document.charset : document.characterSet ? "&charset=" + document.characterSet : "");
        document.write("&loc=" + escape(window.location));
        if (document.referrer) document.write("&referer=" + escape(document.referrer));
        if (document.context) document.write("&context=" + escape(document.context));
        if (document.mmm_fo) document.write("&mmm_fo=1");
        document.write("'></scr" + "ipt>");
    };

    /* Func: Check Banner Left */
    this.check_left = function () {
        $(document).ready(function () {
            if ($("body").width() > 1240) {
                if ($("#advLeft").hasClass("ad_none")) {
                    $("#advLeft").removeClass("ad_none")
                }
                if (!$("#advLeft").hasClass("adLeft")) {
                    $("#advLeft").addClass("adLeft")
                }
            } else {
                if ($("#advLeft").hasClass("adLeft")) {
                    $("#advLeft").removeClass("adLeft")
                }
                if (!$("#advLeft").hasClass("ad_none")) {
                    $("#advLeft").addClass("ad_none")
                }
            }
        })
    };

    /* Func: Check Banner Right */
    this.check_right = function () {
        $(document).ready(function () {
            if ($("body").width() > 1240) {
                if ($("#advRight").hasClass("ad_none")) {
                    $("#advRight").removeClass("ad_none")
                }
                if (!$("#advRight").hasClass("adRight")) {
                    $("#advRight").addClass("adRight")
                }
            } else {
                if ($("#advRight").hasClass("adRight")) {
                    $("#advRight").removeClass("adRight")
                }
                if (!$("#advRight").hasClass("ad_none")) {
                    $("#advRight").addClass("ad_none")
                }
            }
        })
    };

    /* Func: Check Size of div banner */
    this.checkResizeWindow = function(){
        if($('#advTop').attr('id') && $('#advTop_temp').attr('id') ){
            var advTop = $("#advTop").offset();
            $('#advTop_temp').css({
                'left': advTop.left,
                'top': advTop.top
            });
        }      
        if($('#advR1').attr('id') && $('#advR1_temp').attr('id') ){
            var advR1 = $("#advR1").offset();
            $('#advR1_temp').css({
                'left': advR1.left,
                'top': advR1.top
            });
        }        
        if($('#advR2').attr('id') && $('#advR2_temp').attr('id') ){
            var advR2 = $("#advR2").offset();
            $('#advR2_temp').css({
                'left': advR2.left,
                'top': advR2.top
            });
        }
        if($('#advR3').attr('id') && $('#advR3_temp').attr('id') ){
            var advR3 = $("#advR3").offset();
            $('#advR3_temp').css({
                'left': advR3.left,
                'top': advR3.top
            });
        }
        if($('#advFooter').attr('id') && $('#advFooter_temp').attr('id') ){
            var advFooter = $("#advFooter").offset();
            $('#advFooter_temp').css({
                'left': advFooter.left,
                'top': advFooter.top
            });
        }
        if($('#advArticle').attr('id') && $('#advArticle_temp').attr('id') ){
            var advArticle = $("#advArticle").offset();
            $('#advArticle_temp').css({
                'left': advArticle.left,
                'top': advArticle.top
            });
        }
    };

    /* Func: show Banner Right */
    this.showBannerRight = function () {
        this.check_right();
        var zone_id = this.search_zoneid(zaConfig.pageid, "advRight");
        this._display_zone(zone_id);
    };

    /* Func: show Banner Left */
    this.showBannerLeft = function () {
        this.check_left();
        var zone_id = this.search_zoneid(zaConfig.pageid, "advLeft");
        this._display_zone(zone_id);
    };

    /* Func: show Banner Top */
    this.showBannerTop = function () {
        this.showBanner("advTop");
    };

    /* Func: show Banner Right R1 */
    this.showBannerR1 = function () {
        this.showBanner("advR1");
    };

    /* Func: show Banner Right R2 */
    this.showBannerR2 = function () {
        this.showBanner("advR2");
    };

    /* Func: show Banner Right R3 */
    this.showBannerR3 = function () {
        this.showBanner("advR3");
    };

    /* Func: show Banner Article */
    this.showBannerArticle = function () {
        var zone_id = this.search_zoneid(zaConfig.pageid, "advArticle");
        this._display_zone(zone_id);
    };

    /* Func: show Banner Bottom */
    this.showBannerPopup = function () {
        var zone_id = this.search_zoneid(zaConfig.pageid, "advBottom");
        this._display_zone(zone_id);
    };

    /* Func: show Banner Float */
    this.showBannerFloat = function () {
        var zone_id = this.search_zoneid(zaConfig.pageid, "advFloat");
        this._display_zone(zone_id);
    };

    /* Func: show Banner Footer */
    this.showBannerFooter = function () {
        if (zaConfig.articleid == 0) {
            this.showBanner("advFooter");
        }
    };
}
//End Func: vng_ads_lib

var vng_ads = new vng_ads_lib;

$(window).resize(function () {
    vng_ads.check_left();
    vng_ads.check_right();
    vng_ads.checkResizeWindow();
});
